/* ========================================================================= */
/* ------------------------------------------------------------------------- */
/*!
  \file			uservar_basic.h
  \date			Dec 2011
  \author		TNick

  \brief		Contains the definition for UserVar class


*//*


 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Please read COPYING and README files in root folder
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
#ifndef __USERVAR_BASIC_INC__
#define __USERVAR_BASIC_INC__
//
//
//
//
/*  FUNCTIONS    ----------------------------------------------------------- */


/** @name Basic interactions
*
*	Basic information reported by a variable are it's name and it's type
*	(identifying the class that implements UserVar). The name is managed
*	(stored, reported via name() and changed via setName() ) by this class and
*	the type() must be reported as a string by the implementation.
*/
//@{


/**
*	@brief	 report the name of this variable
*/
inline QString			name			( void ) const
{ return name_; }


/**
*	@brief	 change the name of the variable
*/
inline void				setName			( QString s_new_name )
{ name_ = s_new_name; }


/**
*	@brief	 present some fom of string representation
*/
QString					presentation				( void );


/**
*	@brief	 tell if the variable can be assigned or not
*
  *	The value of the variable may be changed by other means. An imaginary
  *	CRT_DRAW variable may report current working unit and can't be assigned,
  *	but the user can change current working unit using the GUI.
  */
inline bool				isReadOnly				( void ) const
{ return ( ( flg_ & FL_READONLY) != 0 ); }


/**
*	@brief	 tell if the variable is a build-in one or is a user-defined variable
*/
inline bool				isPredef				( void ) const
{ return ( ( flg_ & FL_PREDEF) != 0 ); }


/**
*	@brief	 tell if the variable is permanently stored or is a session variable
*/
inline bool				isPermanent				( void ) const
{ if ( isPredef() ) return true; return ( ( flg_ & FL_PERMANENET) != 0 ); }


/**
*	@brief	 request the application to store the variable
*/
inline void				makePermanent			( void )
{ setFlag( FL_PERMANENET ); }


/**
*	@brief	 request the application not to store the variable
*/
inline void				makeVolatile			( void )
{ if ( ! isPredef() ) resetFlag( FL_PERMANENET ); }



//@}


/*  FUNCTIONS    =========================================================== */
//
//
//
//
#endif // __USERVAR_BASIC_INC__
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
